package com.riekoff.particlecubeworld.player;

import java.util.ArrayList;
import java.util.List;

import cc.creativecomputing.graphics.texture.CCTexture2D;
import cc.creativecomputing.graphics.texture.CCTextureData;
import cc.creativecomputing.graphics.texture.CCTextureIO;
import cc.creativecomputing.graphics.texture.CCTexture.CCTextureFilter;
import cc.creativecomputing.graphics.texture.CCTexture.CCTextureTarget;
import cc.creativecomputing.util.logging.CCLog;

public class AColorMaps {
	
	private CCTexture2D _myTexture;

	public AColorMaps(String[] theColorMaps){
		List<CCTextureData> myColorDatas = new ArrayList<>();
		for(String myFile : theColorMaps){
			myFile = myFile.replaceAll("\\\\", "/");
			myColorDatas.add(CCTextureIO.newTextureData(myFile));
		}
		
		_myTexture = new CCTexture2D(100, myColorDatas.size() * 5, CCTextureTarget.TEXTURE_RECT);
		_myTexture.textureFilter(CCTextureFilter.NEAREST);
		
		int myY = 0;
		for(CCTextureData myData : myColorDatas){
			_myTexture.updateData(myData, 0, myY);
			myY += 5;
		}
	}
	
	public CCTexture2D texture(){
		return _myTexture;
	}
}
